﻿#region Using directives

using System;
using System.Collections;
using System.Data;
using UFSoft.UBF.UI.MD.Runtime;
using UFSoft.UBF.UI.MD.Runtime.Implement;

#endregion

namespace UFIDA.U9.Cust.OTD.ZF.SHXM3003.OTDListUI.FOChangeDocBListUIModel
{
	[Serializable]
	public partial class FOChangeDocBListUIModelModel : UIModel
	{
		#region Constructor
		public FOChangeDocBListUIModelModel() : base("FOChangeDocBListUIModel")
		{
			InitClass();
			this.SetResourceInfo("700a4030-0397-4af3-a7de-2e3686ffa929");
            try{
			    AfterInitModel();
            }catch(Exception exception){
              IUIModel model = this;
		      this.ErrorMessage.SetErrorMessage(ref model,exception);
			}
		}

		//just for Clone 
		private FOChangeDocBListUIModelModel(bool isInit) : base("FOChangeDocBListUIModel")
		{}
		protected override IUIModel CreateCloneInstance()
		{
			return new FOChangeDocBListUIModelModel(false);
		}
		#endregion
		#region member
		#region views
		private FOChangeDocView viewFOChangeDoc;			
		#endregion
		
		#region links
		#endregion
		
		#region properties
		#endregion
		#endregion

		#region property
		public FOChangeDocView FOChangeDoc
		{
			get { return (FOChangeDocView)this["FOChangeDoc"]; }
		}
		
		#region RealViews
		#endregion
		
	
		#endregion

		#region function
		private void InitClass()
		{
			this.viewFOChangeDoc = new FOChangeDocView(this);
			this.viewFOChangeDoc.SetResourceInfo("b8a95013-572e-420f-8ace-c15a3147a1fd");
			this.Views.Add(this.viewFOChangeDoc);			

			
		}

		public override string AssemblyName
		{
			get { return "UFIDA.U9.Cust.OTD.ZF.SHXM3003.OTDListUI"; }
		}
		
		#endregion
		private void OnValidate_DefualtImpl()
    {
    }

	}


	[Serializable]
	public partial class FOChangeDocView : UIView
	{
		#region Constructor
		public FOChangeDocView(IUIModel model) : base(model,"FOChangeDoc","UFIDA.U9.Cust.OTD.ZF.SHXM3003.OTDBE.FOChangeBE.FOChangeDoc", true)
		{
			InitClass();
		}
		//构造空实例,不进行初始化.目前为Clone使用.
		private FOChangeDocView():base(null,"FOChangeDoc","UFIDA.U9.Cust.OTD.ZF.SHXM3003.OTDBE.FOChangeBE.FOChangeDoc", true)
		{
		}
		protected override IUIView CreateCloneInstance()
		{
			return new FOChangeDocView();
		}
		#endregion

		#region fiels property filter
		public IUIField FieldID
		{
			get { return this.Fields["ID"]; }
		}


		[Obsolete("请使用CurrentFilter属性，这个方法有可能会导致强弱类型转换出错")]
		public FOChangeDocDefaultFilterFilter DefaultFilter
		{
			get { return (FOChangeDocDefaultFilterFilter)this.CurrentFilter; }
		}
		#endregion

		#region Init
		private void InitClass()
		{
			UIModelRuntimeFactory.AddNewUIField(this,"ID", typeof(Int64), false,"","System.Int64", "ID", true,true, false, "",false,(UIFieldType)1,"ba391065-6c27-4c82-acc8-b52b1c93a910","1daaa885-1b60-4cb5-969a-899ebe81ffda");


			this.CurrentFilter = new FOChangeDocDefaultFilterFilter(this);
		}
		#endregion
		
		#region override method
		protected override IUIRecord BuildNewRecord(IUIRecordBuilder builder)
		{
			return new FOChangeDocRecord(builder);
		}
		#endregion

		#region new method
		public new FOChangeDocRecord FocusedRecord
		{
			get { return (FOChangeDocRecord)base.FocusedRecord ; }
			set { base.FocusedRecord = value ; }
		}
		public new FOChangeDocRecord AddNewUIRecord()
		{	
			return (FOChangeDocRecord)base.AddNewUIRecord();
		}
		public new FOChangeDocRecord NewUIRecord()
		{	
			return (FOChangeDocRecord)base.NewUIRecord();
		}
		#endregion 

	}

	[Serializable]
	public class FOChangeDocRecord : UIRecord
	{
		#region Constructor
		public FOChangeDocRecord(IUIRecordBuilder builder):base(builder)
		{
		}
		private FOChangeDocView uiviewFOChangeDoc
		{
			get { return (FOChangeDocView)this.ContainerView; }
		}
		protected override IUIRecord CreateCloneInstance(IUIRecordBuilder builder)
		{
			return new FOChangeDocRecord(builder);
		}
		#endregion

		#region property
		
		
		public  Int64 ID
		{
			get{
				//object value = this[this.uiviewFOChangeDoc.FieldID] ;
				//return (Int64)value;
				return GetValue<Int64>(this.uiviewFOChangeDoc.FieldID);
			}
			set{
				this[this.uiviewFOChangeDoc.FieldID] = value;
			}
		}
		#endregion
	}
	
	[Serializable]
	public class FOChangeDocDefaultFilterFilter : UIFilter
	{
		#region Constructor
		public FOChangeDocDefaultFilterFilter(IUIView view) 
			: base("DefaultFilter",view,@"",@"")
		{
			InitClass();
		}
		//for Clone Constructor
		private FOChangeDocDefaultFilterFilter()
			: base("DefaultFilter",null,"","")
		{}
		protected override IUIFilter CreateCloneInstance()
		{
			return new FOChangeDocDefaultFilterFilter();
		}
		#endregion

		#region property
		#endregion
		
		#region function
		private void InitClass()
		{
		}
		#endregion

	}



}